# Maintainer: David Sugar <tychosoft@gmail.com>
# Contributor: David Sugar <tychosoft@gmail.com>
pkgname=apollo
pkgver=0.2.1
pkgrel=2
pkgdesc="Web management and api services for Coventry"
url="https://www.tychosoft.com/tychosoft/apollo/wiki"
arch="all"
license="GPL-3.0-or-later"
makedepends="make musl-dev go"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://www.tychosoft.com/api/packages/tychosoft/generic/apollo/$pkgver/apollo-$pkgver.tar.gz apollo.initd"

build() {
	make PREFIX=/usr SYSCONFDIR=/etc LOCALSTATEDIR=/var release
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr SYSCONFDIR=/etc LOCALSTATEDIR=/var install
	install -D -m 755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.md
	install -Dm644 README.md "$pkgdir"/usr/share/doc/$pkgname/README.md
	install -Dm644 FEATURES.md "$pkgdir"/usr/share/doc/$pkgname/FEATURES.md
}

sha512sums="
86627bda730a5d0734f12de5b64ad37916c36803de61391edf8ef241a5e96859b07db7eae68890d4e98e7f5d142a55646215f8404c06bfcba7d5ba3f8f20b4d8  apollo-0.2.1.tar.gz
110cb34c47d2ea9f887b393e24393a2f3224989bc9f659983eaa7fdc678f46ca34f412018a016be331eb53a886b1ca39e8479571fb6c2a0ed6f5294c3a99c16c  apollo.initd
"
